package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)"`
	Password string `gorm:"type:varchar(200)"`
}

type Ear struct {
	gorm.Model
	Title        string `gorm:"type:varchar(200)"`
	Price        int    `gorm:"type:Varchar(200)"`
	Addr         string `gorm:"type:varchar(200)"`
	Color        string `gorm:"type:varchar(200)"`
	CommentCount int    `gorm:"type:int"`
}

type Comment struct {
	gorm.Model
	Content string `gorm:"type:varchar(200)"`
	UserID  int    `gorm:"type:int"`
	User    User   `gorm:"foreignKey:UserID"`
	EarID   int    `gorm:"type:int"`
	Ear     Ear    `gorm:"foreignKey:EarID"`
}
